package org.example.dormsystem.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.dormsystem.pojo.StudentBoard;

import java.util.List;

@Mapper
public interface StudentBoardMapper {
    @Insert("insert into studentBoard(message,postedBy,postDate) values(#{message},#{postedBy},now())")
    void add(StudentBoard studentBoard);

    @Select("select * from studentBoard")
    List<StudentBoard> getAll();
}
